package plugin

import (
	v1 "k8s.io/api/core/v1"
	framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)

func init() {
	clientSet := createClientSet()
	go getRealResourcesLoad(clientSet)
}

var RealResourceRate realResourceMap

type realResourceMap map[string]realResource
type realResource map[v1.ResourceName]int64

type TddhScheduler struct {
	handle framework.FrameworkHandle
	resourceAllocationScorer
}

type resourceToWeightMap map[v1.ResourceName]int64

var defaultRequestedRatioResources = resourceToWeightMap{"cpu": 500, "memory": 500}

type resourceAllocationScorer struct {
	Name                string
	scorer              func(memLoad, cpuLoad resourceToValueMap) int64
	resourceToWeightMap resourceToWeightMap
}

type resourceToValueMap map[v1.ResourceName]int64

var (
	_ framework.FilterPlugin  = &TddhScheduler{}
	_ framework.ScorePlugin   = &TddhScheduler{}
	_ framework.PreBindPlugin = &TddhScheduler{}
)
